SELECT T.*,
T_DICTIONARY_TYPE.ID AS typeId,
T_DICTIONARY_TYPE.code AS typeCode,
T_DICTIONARY_TYPE.name AS typeName,
t_DICTIONARY.code      AS dictionaryCode,
t_DICTIONARY.name      AS dictionaryName
FROM C1_DICTIONARY_ITEM T
LEFT JOIN C1_DICTIONARY t_DICTIONARY
ON (NOW() BETWEEN IFNULL(t_DICTIONARY.begin_date, NOW()) AND IFNULL(t_DICTIONARY.end_date, NOW())
AND t_DICTIONARY.id = t.dictionary_id)
LEFT JOIN C1_DICTIONARY_TYPE T_DICTIONARY_TYPE
ON (NOW() BETWEEN IFNULL(T_DICTIONARY_TYPE.begin_date, NOW()) AND IFNULL(T_DICTIONARY_TYPE.end_date, NOW())
AND T_DICTIONARY_TYPE.ID = t_DICTIONARY.type_id)
WHERE T.ID = :id